<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@include file="/resource/common/taglib.jspf"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title>添加</title>
<%@include file="/resource/common/jquery.jspf"%>
<%@include file="/resource/common/bootstrap.jspf"%>
<%@include file="/resource/common/validate.jspf"%>
<%@include file="/resource/common/kindeditor.jspf"%>
<%@include file="/resource/common/jquery.masonry.jspf"%>
<%@include file="/resource/common/ztree.jspf"%>
<link rel="stylesheet" href="${ctxStatic}/plugins/upload/image.css" type="text/css" media="screen" />
<script type="text/javascript" src="${ctxStatic }/js/system/asyncDoSubmitForm.js"></script>
<script type="text/javascript" src="${ctxStatic }/js/system/picControlUtils.js"></script>
<script type="text/javascript" src="${ctxStatic }/plugins/upload/uploadImageUtils.js"></script>
<script type="text/javascript" src="${ctxStatic }/plugins/jquery/jquery.base64.js"></script>

</head>
<body>
	<div id="body-wrapper">
		<div id="main-content">
			<div class="content-box" >
				<div class="content-box-content">
					<div class="tab-content default-tab" id="tab1">
						<fieldset>
							<input type="hidden" id="asyncResult" name="asyncResult" value="-1" />
							<input type="hidden" id="asyncResultData" name="asyncResultData" value="-1" />
							<input type="hidden" id="asyncResultError" name="asyncResultError" value="-1" />
							<input type="hidden" id="basePhotos" name="basePhotos" value="${entity.basePhotos}"/>
						<form:form id="inputForm" name="form1" class="form-horizontal" method="post" action="addWebHouse.do" modelAttribute="WebHouse">
							<div class="row">
									<div class="col-md-6 col-sm-6 col-xs-6" >
										<input type="hidden" id="id" name="id" value="${entity.id}" />
										<div class="form-group">
											<label class="col-md-4 col-sm-4 col-xs-4 control-label">标题:<span style="color: red">*</span></label>
											<div class="col-md-8 col-sm-8 col-xs-8">
												<input type="text" class="form-control input-sm" value="${entity.title}" name="title" id="title"  placeholder="标题"/>
											</div>
										</div>
										<div class="form-group">
											<label class="col-md-4 col-sm-4 col-xs-4 control-label">类型:</label>
											<div class="col-md-8 col-sm-8 col-xs-8">
												<input type="text" class="form-control input-sm" value="${entity.type}" name="type" id="type"  placeholder="类型"/>
											</div>
										</div>
										<div class="form-group">
											<label class="col-md-4 col-sm-4 col-xs-4 control-label">国家:</label>
											<div class="col-md-8 col-sm-8 col-xs-8">
												<select name="countryId" id="countryId" class="form-control input-sm" onchange="selectCity(this.value);">
													<option value="" <c:if test="${empty entity.countryId}">selected="selected"</c:if>>==请选择==</option>
													<c:forEach var="item" items="${countries }" varStatus="s">
														<option value="${item.id}" <c:if test="${item.id == entity.countryId }"> selected="selected"</c:if>> ${item.name }</option>
													</c:forEach>
												</select>
											</div>
										</div>
										<div class="form-group">
											<label class="col-md-4 col-sm-4 col-xs-4 control-label">州:</label>
											<div class="col-md-8 col-sm-8 col-xs-8">
												<select name="stateId" id="stateId" class="form-control input-sm">
													<option value="" <c:if test="${empty  entity.stateId}">selected="selected"</c:if>>==请选择==</option>
													<c:forEach var="item" items="${state_list }" varStatus="s">
														<option value="${item.id}" <c:if test="${item.id == entity.stateId }"> selected="selected"</c:if>> ${item.chineseName } | ${item.englishName }</option>
													</c:forEach>
												</select>
											</div>
										</div>
										<div class="form-group">
											<label class="col-md-4 col-sm-4 col-xs-4 control-label">城市:</label>
											<div class="col-md-8 col-sm-8 col-xs-8">
												<select name="cityId" id="cityId" class="form-control input-sm">
													<option value="" <c:if test="${empty entity.cityId}">selected="selected"</c:if>>==请选择==</option>
													<c:forEach var="item" items="${city_list }" varStatus="s">
														<option value="${item.id}" <c:if test="${item.id == entity.cityId }"> selected="selected"</c:if>> ${item.chineseName } | ${item.englishName }</option>
													</c:forEach>
												</select>
											</div>
										</div>
										<div class="form-group">
											<label class="col-md-4 col-sm-4 col-xs-4 control-label">邮编:</label>
											<div class="col-md-8 col-sm-8 col-xs-8">
												<input type="text" class="form-control input-sm" value="${entity.postCode}" name="postCode" id="postCode"  placeholder="邮编"/>
											</div>
										</div>
										<div class="form-group">
											<label class="col-md-4 col-sm-4 col-xs-4 control-label">地址:<span style="color: red">*</span></label>
											<div class="col-md-8 col-sm-8 col-xs-8">
												<input type="text" class="form-control input-sm" value="${entity.address}" name="address" id="address"  placeholder="地址"/>
											</div>
										</div>
										<div class="form-group">
											<label class="col-md-4 col-sm-4 col-xs-4 control-label">图片：</label>
											<div class="col-md-8 col-sm-8 col-xs-8">
												<input type="hidden" id="photo" name="photo" value="${entity.photo }"/>
												<input type="hidden" id="filedata" name="filedata" />
												<input type="hidden" id="fileext" name="fileext" />
												<div id="uploadPreview" class="uploadPreview">
													5M大小以内
												</div>
											</div>
										</div>
										<div class="form-group form-group-sm">
											<label for="formGroupInputSmall" class="col-md-4 col-sm-4 col-xs-4 control-label"></label>
											<div class="col-md-8 col-sm-8 col-xs-8">
												<input id="uploadImage" type="file" name="photoimage" class="fimg1" />
											</div>
										</div>
										<div  style="color: red;text-align: center;margin-bottom: 10px;margin-left: -150px;" id="msg"></div>
										<div class="form-group">
											<label class="col-md-4 col-sm-4 col-xs-4 control-label">纬度:</label>
											<div class="col-md-8 col-sm-8 col-xs-8">
												<input type="text" class="form-control input-sm" value="${entity.latitude}" name="latitude" id="latitude"  placeholder="纬度"/>
											</div>
										</div>
										<div class="form-group">
											<label class="col-md-4 col-sm-4 col-xs-4 control-label">经度:</label>
											<div class="col-md-8 col-sm-8 col-xs-8">
												<input type="text" class="form-control input-sm" value="${entity.longitude}" name="longitude" id="longitude"  placeholder="经度"/>
											</div>
										</div>
										<div class="form-group">
											<label class="col-md-4 col-sm-4 col-xs-4 control-label">交房日期:</label>
											<div class="col-md-8 col-sm-8 col-xs-8">
												<input type="text" class="form-control input-sm" value="${entity.handoverDate}" name="handoverDate" id="handoverDate"  placeholder="交房日期"/>
											</div>
										</div>
										<div class="form-group">
											<label class="col-md-4 col-sm-4 col-xs-4 control-label">投资类型:</label>
											<div class="col-md-8 col-sm-8 col-xs-8">
												<c:forEach var="item" items="${investment_type_list}" varStatus="abc">
													<c:set var="isContains" value="${fn:contains(entity.investmentTypeIds,item.id)}" />
													<c:choose>
														<c:when test="${isContains}">
															<label>
																<input type="checkbox" name="investmentTypeIds" checked="checked" value="${item.id}"> ${item.title}
															</label>
														</c:when>
														<c:otherwise>
															<label>
																<input type="checkbox" name="investmentTypeIds" value="${item.id}"> ${item.title}
															</label>
														</c:otherwise>
													</c:choose>
												</c:forEach>
											</div>
										</div>
										<div class="form-group">
											<label class="col-md-4 col-sm-4 col-xs-4 control-label">主力户型:</label>
											<div class="col-md-8 col-sm-8 col-xs-8">
												<c:forEach var="item" items="${house_type_list}" varStatus="abc">
												<c:set var="isContains" value="${fn:contains(entity.houseTypeIds,item.id)}" />
													<c:choose>
														<c:when test="${isContains}">
															<label style="padding-left:5px;">
																<input type="checkbox" name="houseTypeIds" checked="checked" value="${item.id}"> ${item.title}
															</label>
														</c:when>
														<c:otherwise>
															<label style="padding-left:5px;">
																<input type="checkbox" name="houseTypeIds" value="${item.id}"> ${item.title}
															</label>
														</c:otherwise>
													</c:choose>
												</c:forEach>
											</div>
										</div>

									</div>
									<div class="col-md-6 col-sm-6 col-xs-6" >
										<div class="form-group">
											<label class="col-md-4 col-sm-4 col-xs-4 control-label">项目类型:</label>
											<div class="col-md-8 col-sm-8 col-xs-8">
												<select name="projectTypeId" id="projectTypeId" class="form-control input-sm">
													<option value="" <c:if test="${empty entity.projectTypeId}">selected="selected"</c:if>>==请选择==</option>
													<c:forEach var="item" items="${project_type_list }" varStatus="s">
														<option value="${item.id}" <c:if test="${item.id == entity.projectTypeId }"> selected="selected"</c:if>> ${item.title }</option>
													</c:forEach>
												</select>
											</div>
										</div>
										<div class="form-group">
											<label class="col-md-4 col-sm-4 col-xs-4 control-label">价格段:</label>
											<div class="col-md-8 col-sm-8 col-xs-8">
												<select name="priceSectionId" id="priceSectionId" class="form-control input-sm">
													<option value="" <c:if test="${empty entity.priceSectionId}">selected="selected"</c:if>>==请选择==</option>
													<c:forEach var="item" items="${price_section_list }" varStatus="s">
														<option value="${item.id}" <c:if test="${item.id == entity.priceSectionId }"> selected="selected"</c:if>> ${item.title }</option>
													</c:forEach>
												</select>
											</div>
										</div>
										<div class="form-group">
											<label class="col-md-4 col-sm-4 col-xs-4 control-label">价格:</label>
											<div class="col-md-8 col-sm-8 col-xs-8">
												<input type="text" class="form-control input-sm" value="${entity.price}" name="price" id="price"  placeholder="价格"/>
											</div>
										</div>
										<div class="form-group">
											<label class="col-md-4 col-sm-4 col-xs-4 control-label">最小价格:</label>
											<div class="col-md-8 col-sm-8 col-xs-8">
												<input type="text" class="form-control input-sm" value="${entity.minPrice}" name="minPrice" id="minPrice"  placeholder="最小价格"/>
											</div>
										</div>
										<div class="form-group">
											<label class="col-md-4 col-sm-4 col-xs-4 control-label">最大价格:</label>
											<div class="col-md-8 col-sm-8 col-xs-8">
												<input type="text" class="form-control input-sm" value="${entity.maxPrice}" name="maxPrice" id="maxPrice"  placeholder="最大价格"/>
											</div>
										</div>
										<div class="form-group">
											<label class="col-md-4 col-sm-4 col-xs-4 control-label">面积:</label>
											<div class="col-md-8 col-sm-8 col-xs-8">
												<input type="text" class="form-control input-sm" value="${entity.area}" name="area" id="area"  placeholder="面积"/>
											</div>
										</div>
										<div class="form-group">
											<label class="col-md-4 col-sm-4 col-xs-4 control-label">最小面积:</label>
											<div class="col-md-8 col-sm-8 col-xs-8">
												<input type="text" class="form-control input-sm" value="${entity.minArea}" name="minArea" id="minArea"  placeholder="最小面积"/>
											</div>
										</div>
										<div class="form-group">
											<label class="col-md-4 col-sm-4 col-xs-4 control-label">最大面积:</label>
											<div class="col-md-8 col-sm-8 col-xs-8">
												<input type="text" class="form-control input-sm" value="${entity.maxArea}" name="maxArea" id="maxArea"  placeholder="最大面积"/>
											</div>
										</div>
										<div class="form-group">
											<label class="col-md-4 col-sm-4 col-xs-4 control-label">最近一年房价涨幅(%):<span style="color: red">*</span></label>
											<div class="col-md-8 col-sm-8 col-xs-8">
												<input type="text" class="form-control input-sm" value="${entity.rose}"
													   name="rose" id="rose"  placeholder="最近一年房价涨幅(如：20%请输入20即可)"/>
											</div>
										</div>
										<div class="form-group">
											<label class="col-md-4 col-sm-4 col-xs-4 control-label">年均租金收益(%):<span style="color: red">*</span></label>
											<div class="col-md-8 col-sm-8 col-xs-8">
												<input type="text" class="form-control input-sm" value="${entity.rent}"
													   name="rent" id="rent"  placeholder="年均租金收益(如：20%请输入20即可)"/>
											</div>
										</div>
										<div class="form-group">
											<label class="col-md-4 col-sm-4 col-xs-4 control-label">首付比例(%):<span style="color: red">*</span></label>
											<div class="col-md-8 col-sm-8 col-xs-8">
												<input type="text" class="form-control input-sm" value="${entity.downPayment}"
													   name="downPayment" id="downPayment"  placeholder="首付比例(如：20%请输入20即可)"/>
											</div>
										</div>
										<div class="form-group">
											<label class="col-md-4 col-sm-4 col-xs-4 control-label">房屋产权:<span style="color: red">*</span></label>
											<div class="col-md-8 col-sm-8 col-xs-8">
												<input type="text" class="form-control input-sm" value="${entity.housingProperty}" name="housingProperty" id="housingProperty"  placeholder="房屋产权"/>
											</div>
										</div>
										<div class="form-group">
											<label class="col-md-4 col-sm-4 col-xs-4 control-label">房产税(%):</label>
											<div class="col-md-8 col-sm-8 col-xs-8">
												<input type="text" class="form-control input-sm" value="${entity.propertyTax}" name="propertyTax" id="propertyTax"  placeholder="房产税(如：20%请输入20即可)"/>
											</div>
										</div>
										<div class="form-group">
											<label class="col-md-4 col-sm-4 col-xs-4 control-label">物业费:</label>
											<div class="col-md-8 col-sm-8 col-xs-8">
												<input type="text" class="form-control input-sm" value="${entity.propertyFee}" name="propertyFee" id="propertyFee"  placeholder="物业费"/>
											</div>
										</div>
										<div class="form-group">
											<label class="col-md-4 col-sm-4 col-xs-4 control-label">年利率:</label>
											<div class="col-md-8 col-sm-8 col-xs-8">
												<input type="text" class="form-control input-sm" value="${entity.apr}" name="apr" id="apr"  placeholder="年利率"/>
											</div>
										</div>
										<div class="form-group">
											<label class="col-md-4 col-sm-4 col-xs-4 control-label">标签:</label>
											<div class="col-md-8 col-sm-8 col-xs-8">
												<input type="text" class="form-control input-sm" value="${entity.tags}" name="tags" id="tags"  placeholder="标签"/>
											</div>
										</div>
										<div class="form-group">
											<label class="col-md-4 col-sm-4 col-xs-4 control-label">状态:</label>
											<div class="col-md-8 col-sm-8 col-xs-8">
												<select name="status" id="status" class="form-control input-sm">
													<option value="1" <c:if test="${entity.status==1 }">selected="selected"</c:if>>热卖</option>
													<option value="2" <c:if test="${entity.status==2 }">selected="selected"</c:if>>在售</option>
													<option value="3" <c:if test="${entity.status==3 }">selected="selected"</c:if>>售罄</option>
													<option value="4" <c:if test="${entity.status==4 }">selected="selected"</c:if>>稀缺</option>
													<option value="5" <c:if test="${entity.status==5 }">selected="selected"</c:if>>特惠</option>
													<option value="6" <c:if test="${entity.status==6 }">selected="selected"</c:if>>尾盘</option>
												</select>
											</div>
										</div>
										<div class="form-group">
											<label class="col-md-4 col-sm-4 col-xs-4 control-label">是否展示:</label>
											<div class="col-md-8 col-sm-8 col-xs-8">
												<select name="isShow" id="isShow" class="form-control input-sm">
													<option value="true" <c:if test="${entity.isShow==true }">selected="selected"</c:if>>是</option>
													<option value="false" <c:if test="${entity.isShow==false }">selected="selected"</c:if>>否</option>
												</select>
											</div>
										</div>
										<div class="form-group">
											<label class="col-md-4 col-sm-4 col-xs-4 control-label">是否推荐:</label>
											<div class="col-md-8 col-sm-8 col-xs-8">
												<select name="isRecommend" id="isRecommend" class="form-control input-sm">
													<option value="false" <c:if test="${entity.isRecommend==false }">selected="selected"</c:if>>否</option>
													<option value="true" <c:if test="${entity.isRecommend==true }">selected="selected"</c:if>>是</option>
												</select>
											</div>
										</div>
										<div class="form-group">
											<label class="col-md-4 col-sm-4 col-xs-4 control-label">是否置顶:</label>
											<div class="col-md-8 col-sm-8 col-xs-8">
												<select name="isTop" id="v" class="form-control input-sm">
													<option value="false" <c:if test="${entity.isTop==false }">selected="selected"</c:if>>否</option>
													<option value="true" <c:if test="${entity.isTop==true }">selected="selected"</c:if>>是</option>
												</select>
											</div>
										</div>

										<div class="form-group">
											<label class="col-md-4 col-sm-4 col-xs-4 control-label">浏览量:</label>
											<div class="col-md-8 col-sm-8 col-xs-8">
												<input type="text" class="form-control input-sm" value="${empty entity.pageView?"0":entity.pageView}" name="pageView" id="pageView"  placeholder="浏览量"/>
											</div>
										</div>
										<div class="form-group">
											<label class="col-md-4 col-sm-4 col-xs-4 control-label">虚拟浏览量:</label>
											<div class="col-md-8 col-sm-8 col-xs-8">
												<input type="text" class="form-control input-sm" value="${empty entity.virtualPageView?"0":entity.virtualPageView}" name="virtualPageView" id="virtualPageView"  placeholder="虚拟浏览量"/>
											</div>
										</div>
										<div class="form-group">
											<label class="col-md-4 col-sm-4 col-xs-4 control-label">排序:</label>
											<div class="col-md-8 col-sm-8 col-xs-8">
												<input type="text" class="form-control input-sm" value="${empty entity.sort?"10":entity.sort}" name="sort" id="sort"  placeholder="排序"/>
											</div>
										</div>

									</div>
								</div>

								<div class="row">
									<div class="col-md-12 col-sm-12 col-xs-12" >
										<div class="form-group">
											<label class="col-md-2 col-sm-2 col-xs-2 control-label">seoTitle:</label>
											<div class="col-md-10 col-sm-10 col-xs-10">
												<input type="text" class="form-control input-sm" value="${entity.seoTitle}" name="seoTitle" id="seoTitle"  placeholder="seoTitle"/>
											</div>
										</div>
										<div class="form-group">
											<label class="col-md-2 col-sm-2 col-xs-2 control-label">seoKeyword:</label>
											<div class="col-md-10 col-sm-10 col-xs-10">
												<input type="text" class="form-control input-sm" value="${entity.seoKeyword}" name="seoKeyword" id="seoKeyword"  placeholder="seoKeyword"/>
											</div>
										</div>
										<div class="form-group">
											<label class="col-md-2 col-sm-2 col-xs-2 control-label">seoDescription:</label>
											<div class="col-md-10 col-sm-10 col-xs-10">
												<input type="text" class="form-control input-sm" value="${entity.seoDescription}" name="seoDescription" id="seoDescription"  placeholder="seoDescription"/>
											</div>
										</div>
									</div>

									<div class="form-group">
										<label class="col-md-2 col-sm-2 col-xs-2 control-label">项目特色:</label>
										<div class="col-md-10 col-sm-10 col-xs-10">
											<textarea id="feature" name="feature" class="form-control input-sm">${entity.feature }</textarea> 您当前输入了 <span class="word_count_feature">0</span> 个文字。（字数统计包含纯文本、IMG、EMBED，不包含换行符，IMG和EMBED算一个文字。）
										</div>
									</div>
									<div class="form-group">
										<label class="col-md-2 col-sm-2 col-xs-2 control-label">交通情况:</label>
										<div class="col-md-10 col-sm-10 col-xs-10">
											<textarea id="traffic" name="traffic" class="form-control input-sm">${entity.traffic }</textarea> 您当前输入了 <span class="word_count_traffic">0</span> 个文字。（字数统计包含纯文本、IMG、EMBED，不包含换行符，IMG和EMBED算一个文字。）
										</div>
									</div>
									<div class="form-group">
										<label class="col-md-2 col-sm-2 col-xs-2 control-label">项目配套:</label>
										<div class="col-md-10 col-sm-10 col-xs-10">
											<textarea id="mating" name="mating" class="form-control input-sm">${entity.mating }</textarea> 您当前输入了 <span class="word_count_mating">0</span> 个文字。（字数统计包含纯文本、IMG、EMBED，不包含换行符，IMG和EMBED算一个文字。）
										</div>
									</div>
									<div class="form-group">
										<label class="col-md-2 col-sm-2 col-xs-2 control-label">学区:</label>
										<div class="col-md-10 col-sm-10 col-xs-10">
											<textarea id="schoolDistrict" name="schoolDistrict" class="form-control input-sm">${entity.schoolDistrict }</textarea> 您当前输入了 <span class="word_count_schoolDistrict">0</span> 个文字。（字数统计包含纯文本、IMG、EMBED，不包含换行符，IMG和EMBED算一个文字。）
										</div>
									</div>
									<div class="form-group">
										<label class="col-md-2 col-sm-2 col-xs-2 control-label">视频:</label>
										<div class="col-md-10 col-sm-10 col-xs-10">
											<textarea id="video" name="video" class="form-control input-sm">${entity.video }</textarea>
										</div>
									</div>
									<div class="form-group">
										<label class="col-md-2 col-sm-2 col-xs-2 control-label">户型介绍:</label>
										<div class="col-md-10 col-sm-10 col-xs-10">
											<textarea id="description" name="description"  class="form-control input-sm">${entity.description }</textarea> 您当前输入了 <span class="word_count_description">0</span> 个文字。（字数统计包含纯文本、IMG、EMBED，不包含换行符，IMG和EMBED算一个文字。）
										</div>
									</div>
								</div>

								<div class="row">
									<div class="col-md-12 col-sm-12 col-xs-12">
										<div class="form-group">
											<label class="col-md-2 col-sm-2 col-xs-2 control-label">图片集:</label>
											<div class="col-md-10 col-sm-10 col-xs-10">
														<label class="col-md-1 col-sm-1 col-xs-1 control-label">
														<input type="hidden" id="photos" name="photos" value="${entity.photos}"/>
														<a href="javascript:void(0)"
														   onclick="picControlUtils.layerOpenByBootstrapFileInputCallBack('photos','yppicinfoshow',1);"
														   class="btn btn-sm btn-success" >
														<i class="fa fa-cloud-upload"></i>&nbsp;&nbsp;本地图片上传</a></label>
											</div>
										</div>
										<div class="form-group">
											<label class="col-md-2 col-sm-2 col-xs-2 control-label"></label>
											<div class="col-md-10 col-sm-10 col-xs-10">
												<table class="table table-bordered table-hover">
													<tbody>
													<div id="con1" class="con">
														<div id="yppicinfoshow"></div>
													</div>
													</tbody>
												</table>
											</div>
										</div>
									</div>
								</div>
					</div>
							</form:form>
						</fieldset>
					</div>
				</div>
			</div>

	</div>
	</div>
<script type="text/javascript">
var result = 0;
var validateForm;
$(document).ready(function() {

    //初始在线编辑器
    ShowEditorHtml("#feature", "word_count_feature");
    ShowEditorHtml("#traffic", "word_count_traffic");
    ShowEditorHtml("#mating", "word_count_mating");
    ShowEditorHtml("#schoolDistrict", "word_count_schoolDistrict");
    //ShowEditorHtml("#video", "word_count_video");
    ShowEditorHtml("#description", "word_count_description");

    picControlUtils.loadInitShow('photos','basePhotos', 'yppicinfoshow',1);
    $('#con1').imagesLoaded(function() {
        $('#con1').masonry({
            itemSelector : '.product_list',
            columnWidth : 5
            //每两列之间的间隙为5像素
        });
    });
	validateForm = $("#inputForm").validate({
		rules : {
			title : {
				required : true
			},
			address : {
				required : true
			},
			photo : {
				required : true
			},
			rose : {
				required : true,
                number: true
			},
			rent : {
				required : true,
                number: true
			},
			downPayment : {
				required : true,
                number: true
			},
			housingProperty : {
				required : true
			},
			status : {
				required : true
			},
			isShow : {
				required : true
			},
			isDelete : {
				required : true
			},
			isRecommend : {
				required : true
			},
			isTop : {
				required : true
			},
			sort : {
				required : true,
                digits: true
			},
            price:{
                number: true
			},
            maxPrice:{
                number: true
            },
            minPrice:{
                number: true
            },
            Area:{
                number: true
            },
            minArea:{
                number: true
            },
            minArea:{
                number: true
            }
		},
		messages : {
			title : {
				required : "标题不能为空"
			},
			address : {
				required : "地址不能为空"
			},
			photo : {
				required : "图片不能为空"
			},
			rose : {
				required : "最近一年房价涨幅不能为空"
			},
			rent : {
				required : "年均租金收益不能为空"
			},
			downPayment : {
				required : "首付比例不能为空"
			},
			housingProperty : {
				required : "房屋产权不能为空"
			},
			status : {
				required : "状态，1热卖,2在售,3售罄,4稀缺,5特惠,6尾盘不能为空"
			},
			isShow : {
				required : "是否展示不能为空"
			},
			isDelete : {
				required : "是否删除不能为空"
			},
			isRecommend : {
				required : "是否推荐不能为空"
			},
			isTop : {
				required : "是否置顶不能为空"
			},
			sort : {
				required : "排序不能为空"
			},
            price:{
                number: "只能输入数字"
            },
            maxPrice:{
                number: "只能输入数字"
            },
            minPrice:{
                number: "只能输入数字"
            },
            Area:{
                number: "只能输入数字"
            },
            minArea:{
                number: "只能输入数字"
            },
            minArea:{
                number: "只能输入数字"
            }
		},
		errorElement : "em",
		errorClass : "validate_error",
		submitHandler: function(form) { //通过之后回调
		},
		invalidHandler: function(form, validator) {
			return false;
		}
	});

    $("#uploadImage").imageUploadUtils({
        data : "#filedata",
        ext : "#fileext",
        msg : "#msg",
        preview : "#uploadPreview",
    });

    var photo = "${entity.photo}";
    var bg = "resource/images/no_photo.png";
    if(photo!=''){
        bg = photo;
    }
    $("#uploadPreview").css("background-image", "url("+bg+")");



});

function selectCity(countryId) {
    $.ajax({
        type : "GET",
        url : 'cities.do?countryId='+countryId,
        async : true,
        dataType : 'json',
        success : function(data) {
			if(data.ret==1){
                $("#cityId").empty();
                $.each(data.data, function (i, item) {
                    $("#cityId").append("<option value="+item.id+">"+item.chineseName+"|"+item.englishName+"</option>");
                });
                $("#cityId").prepend("<option value=''>==请选择==</option>"); //在前面插入一项option
			}
        }
    });
}

</script>
</body>
</html>